package com.hand.test02.controller;

import com.hand.test02.domain.Attach;
import com.hand.test02.service.IAttachService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 马旭阳
 * @date2019/7/26
 */
@RestController
public class AttachController {
    @Autowired
    private IAttachService attachService;
    @PostMapping("/attach/id")
    public Attach queryAttachById(@RequestParam("id") Integer id){
        return attachService.queryAttachById(id);
    }
    @PostMapping("/attach")
    public void insertAttach(@RequestBody Attach attach){
        attachService.insertAttach(attach);
    }
    @PutMapping("/attach/height")
    public void updateAttach(@RequestBody Attach attach){
        attachService.updateAttach(attach);
    }
    @DeleteMapping("/attach/aId")
    public void deleteAttach(@RequestParam Integer id){
        attachService.deleteAttach(id);
    }
}
